package com.yeung.annotation.service;

import com.yeung.annotation.entity.Person;
import com.yeung.annotation.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    //@Autowired 可以放在数组,list, map 上 它会通过类型自动装配
    @Autowired
    public UserRepository userRepository;

    public void add() {
        System.out.println("userService add ...");
        userRepository.save(new Person("zara", 23));
    }
}
